function getURL(){
	var user = document.getElementById("form_user").value;
	var typeGroup = document.getElementById("form_type");
	var moreGroup = document.getElementById("form_more_no");

	var type = typeGroup.options[typeGroup.selectedIndex].value;
	var more = !moreGroup.checked;

	var base = document.getElementById("form").action;
	if(base.indexOf("http://") == -1){
		base = document.URL.substring(0, document.URL.lastIndexOf('/')) + '/' + base;
	}
	
	var url = base + '?user=' + encodeURI(user) + '&type=' + type + '&more=' + more;
	
	document.getElementById("form_user").value = url;
	document.getElementById("form_user").focus();
	document.getElementById("form_user").select();
	return false;
}

function addToGoogleCalendar(){
	var user = document.getElementById("form_user").value;
	var moreGroup = document.getElementById("form_more_no");
	var more = !moreGroup.checked;
	
	var base = document.getElementById("form").action;
	if(base.indexOf("http://") == -1){
		base = document.URL.substring(0, document.URL.lastIndexOf('/')) + '/' + base;
	}
	
	var url = base + '?user=' + encodeURI(user) + '&more=' + more + '&type=txt';
	url = 'http://www.google.com/calendar/render?cid=' + encodeURIComponent(url);

	window.location = url;
}